
#include<stdio.h>
int main()
{
	char arr[20] = { 0 };
	char brr[20] = { 0 };
	gets(arr);
	gets(brr);
	int i = 0, aBs = 0;
	do
	{
		if (arr[i] == brr[i])
		{
			i++;
		}
		
		if(arr[i] != brr[i])
		{
			aBs = arr[i] - brr[i];
			break;
		}
		else if (arr[i] == '\0')
		{
			aBs = 0;
			break;
		}
	} while (1);
	printf("%d", aBs);



	return 0;
}